import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { BaseService } from 'src/modules/base.service';
import { Repository } from 'typeorm';
import { CreatePositionDto, UpdatePositionDto } from './position.dto';
import { Position } from './position.entity';
@Injectable()
export class PositionService extends BaseService {
  module: Repository<Position>;
  constructor(
    @InjectRepository(Position)
    private positionsRepository: Repository<Position>,
  ) {
    super();
    this.module = this.positionsRepository;
  }

  async create(data: CreatePositionDto): Promise<any> {
    return await this.positionsRepository.save(data);
  }

  async update(data: UpdatePositionDto): Promise<any> {
    return this.positionsRepository.save(data);
  }
}
